To protect against data loss, a storage system can include a redundant array of inexpensive disks (“RAID”). The RAID level used for a RAID array depends on a number of factors including redundancy level, performance and reliability of the desired array. Standard RAID levels include RAID 1, RAID 4, RAID 5, RAID 6, etc. For example, in RAID 5, data is striped across the plurality of disks in the RAID array. In a four disk array, a RAID stripe includes data chunk D1 stored on disk 1, data chunk D2 stored on disk 2, data chunk D3 stored on disk 3 and parity chunk PA stored on disk 4. Additionally, the parity chunks in a RAID 5 array are distributed or staggered across the plurality of disks. In the event of disk failure, the chunk contained on the failed disk can be computed based on the chunks contained on the remaining disks of the RAID array. For example, if disk 1 fails, data chunk D1 can be computed based on data chunk D2 stored on disk 2, data chunk D3 stored on disk 3 and parity chunk PA stored on disk 4.
It is possible that one or more sectors of a disk can experience media errors, i.e., become damaged or un-useable for a period of time. Media errors can be caused by dust or moisture, for example. When a RAID array is in a degraded state (e.g., a disk has failed) and a sector of another disk experiences a medium error, data recovery might not be possible. For example, if the medium error exists in a data chunk (or parity chunk) of a RAID stripe, then a data chunk (or parity chunk) of the RAID stripe contained on the failed disk cannot be recovered because there is not enough information available to compute the missing data chunk. Accordingly, in order to avoid the above problem, patrol reads are performed on an optimal RAID array to identify and fix media errors.